<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>驼峰式匹配</title>
</head>
<body>
  <script>
    function fn(queries, pattern) {
      return queries.map(query => {
        let i = 0
        for (let char of query) {
          //当前字符与模式字符相匹配
          if (char === pattern[i]) i += 1;
          //跳过一切小写字母
          else if ('a' <= char && char <= 'z') { }
          //大写字母与模式字符不匹配
          else return false;
        }
        return i === pattern.length
      })
    }
    console.log(fn(['FooBar', 'FooBarTest', 'FootBall', 'FrameBuffer', 'ForceFeedBack'], 'FB'))
  </script>
</body>
</html>